package com.srk.Jface.Helloworld;

import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class JfaceViewer2 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Display display = new Display();
		Shell shell = new Shell(display);
		shell.setText("SRK Tree");
		shell.setBounds(120, 120, 220, 220);
		shell.setLayout(new FillLayout());

		TreeViewer treeViewer = new TreeViewer(shell);
		treeViewer.setContentProvider(new SrkContentProvider());
		treeViewer.setLabelProvider(new SrkLabelprovider());
		treeViewer.setInput("root");
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}

	}
}
